package com.jijs.jws;

import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;

public class TestClient {

	public static void main(String[] args) throws MalformedURLException {
		//创建访问wsdl服务地址的URL
		URL url = new URL("http://localhost:8080/hello?wsdl");
//		namespaceURI:targetNamespace="http://jws.jijs.com/"
//		localPart:name="HelloService"
		//通过QName指明服务的具体信息
		QName qname = new QName("http://jws.jijs.com/", "HelloService");
		//创建服务
		Service service = Service.create(url, qname);
		//实现接口
		IHello hello = service.getPort(IHello.class);
		String s = hello.sayHello("你好");
		System.out.println(s);
		//以上服务有问题，依然依赖IHello接口
	}
}
